const dataMap = [
  { name: "病人姓名", key: "patientname" },
  { name: "性别", key: "sex" },
  { name: "生日", key: "birthday" },
  { name: "身份证号码", key: "ssn" },
  { name: "住院号,病历号", key: "mrn" },
  { name: "随访状态", key: "followupstatus" },
  { name: "末次随访时间", key: "lastfollowupdate" },
  { name: "首次治疗时间", key: "firstcuredate" },
  { name: "缺省联系人", key: "defaultcontactname" },
  { name: "缺省联系电话", key: "defaultphone" },
  { name: "缺省Email地址", key: "defaultemail" },
  { name: "缺省联系地址", key: "defaultaddress" },
  { name: "缺省邮编", key: "defaultzip" },
  { name: "联系方式备注", key: "memo" },
  { name: "有无默认联系地址", key: "hasactiveaddress" },
  { name: "联系人1", key: "contactname1" },
  { name: "联系人电话1", key: "phone1" },
  { name: "联系人emial1", key: "email1" },
  { name: "联系人地址1", key: "address1" },
  { name: "邮编1", key: "zip1" },
  { name: "联系人2", key: "contactname2" },
  { name: "联系人电话2", key: "phone2" },
  { name: "联系人Email2", key: "email2" },
  { name: "联系人地址2", key: "address2" },
  { name: "邮编2", key: "zip2" },
  { name: "联系人3", key: "contactname3" },
  { name: "联系人电话3", key: "phone3" },
  { name: "联系人Email3", key: "email3" },
  { name: "联系人地址3", key: "address3" },
  { name: "邮编3", key: "zip3" },
  { name: "原发肿瘤 ICD 1", key: "ptdxcode1" },
  { name: "原发肿瘤名称 1", key: "ptdxdescription1" },
  { name: "原发肿瘤时间 1", key: "ptdxdate1" },
  { name: "原发肿瘤分组 1", key: "ptdxdrgcategorycode1" },
  { name: "原发肿瘤1复发时间", key: "ptdxrecurrencedate1" },
  { name: "原发肿瘤1第1次转移的部位", key: "pt1metastatic1location" },
  { name: "原发肿瘤1第1次转移的时间", key: "pt1metastatic1date" },
  { name: "原发肿瘤1第2次转移的部位", key: "pt1metastatic2location" },
  { name: "原发肿瘤1第2次转移的时间", key: "pt1metastatic2date" },
  { name: "原发肿瘤1第3次转移的部位", key: "pt1metastatic3location" },
  { name: "原发肿瘤1第3次转移的时间", key: "pt1metastatic3date" },
  { name: "原发肿瘤1第4次转移的部位", key: "pt1metastatic4location" },
  { name: "原发肿瘤1第4次转移的时间", key: "pt1metastatic4date" },
  { name: "原发肿瘤1第5次转移的部位", key: "pt1metastatic5location" },
  { name: "原发肿瘤1第5次转移的时间", key: "pt1metastatic5date" },
  { name: "原发肿瘤名称 2", key: "ptdxdescription2" },
  { name: "原发肿瘤时间 2", key: "ptdxdate2" },
  { name: "原发肿瘤分组 2", key: "ptdxdrgcategorycode2" },
  { name: "原发肿瘤2复发时间", key: "ptdxrecurrencedate2" },
  { name: "原发肿瘤2第1次转移的部位", key: "pt2metastatic1location" },
  { name: "原发肿瘤2第1次转移的时间", key: "pt2metastatic1date" },
  { name: "原发肿瘤2第2次转移的部位", key: "pt2metastatic2location" },
  { name: "原发肿瘤2第2次转移的时间", key: "pt2metastatic2date" },
  { name: "原发肿瘤2第3次转移的部位", key: "pt2metastatic3location" },
  { name: "原发肿瘤2第3次转移的时间", key: "pt2metastatic3date" },
  { name: "原发肿瘤2第4次转移的部位", key: "pt2metastatic4location" },
  { name: "原发肿瘤2第4次转移的时间", key: "pt2metastatic4date" },
  { name: "原发肿瘤2第5次转移的部位", key: "pt2metastatic5location" },
  { name: "原发肿瘤2第5次转移的时间", key: "pt2metastatic5date" },
  { name: "原发肿瘤名称 3", key: "ptdxdescription3" },
  { name: "原发肿瘤时间 3", key: "ptdxdate3" },
  { name: "原发肿瘤分组 3", key: "ptdxdrgcategorycode3" },
  { name: "原发肿瘤3复发时间", key: "ptdxrecurrencedate3" },
  { name: "原发肿瘤3第1次转移的部位", key: "pt3metastatic1location" },
  { name: "原发肿瘤3第1次转移的时间", key: "pt3metastatic1date" },
  { name: "原发肿瘤3第2次转移的部位", key: "pt3metastatic2location" },
  { name: "原发肿瘤3第2次转移的时间", key: "pt3metastatic2date" },
  { name: "原发肿瘤3第3次转移的部位", key: "pt3metastatic3location" },
  { name: "原发肿瘤3第3次转移的时间", key: "pt3metastatic3date" },
  { name: "原发肿瘤3第4次转移的部位", key: "pt3metastatic4location" },
  { name: "原发肿瘤3第4次转移的时间", key: "pt3metastatic4date" },
  { name: "原发肿瘤3第5次转移的部位", key: "pt3metastatic5location" },
  { name: "原发肿瘤3第5次转移的时间", key: "pt3metastatic5date" },
  { name: "是否首次治疗", key: "isfirstcure" },
  { name: "死亡日期", key: "deathdate" },
  { name: "死亡原因", key: "deathreason" },
  { name: "", key: "deathdateuncertainty" },
  { name: "", key: "failphone" },
  { name: "最后更新时间", key: "lastupdatetime" },
  { name: "", key: "followcount" },
  { name: "", key: "isautoupdate" },
  { name: "", key: "followtype" },
  { name: "", key: "followupvariablemark" },
];

let info = {
  id: 9,
  patientid: "3326903",
  oid: null,
  patientname: "陈国芳",
  sex: "女",
  birthday: "1974-08-12",
  ssn: "340123197408120000 ",
  mrn: "2028059",
  followupstatus: "O",
  hasactivesheet: null,
  lastfollowupdate: "2021-02-19 18:17:48",
  firstcuredate: null,
  defaultcontactname: null,
  defaultphone: "18756512782 ",
  defaultemail: null,
  defaultaddress: null,
  defaultzip: null,
  memo: null,
  hasactiveaddress: null,
  contactname1: null,
  phone1: "18756512785 ",
  email1: null,
  address1: null,
  zip1: null,
  contactname2: null,
  phone2: null,
  email2: null,
  address2: null,
  zip2: null,
  contactname3: null,
  phone3: null,
  email3: null,
  address3: null,
  zip3: null,
  ptdxcode1: "C50",
  ptdxdescription1: "乳腺癌",
  ptdxdate1: null,
  ptdxdrgcategorycode1: "01",
  ptdxrecurrencedate1: "2021-02-19 12:47:04",
  pt1metastatic1location: "无",
  pt1metastatic1date: "2021-02-26 00:00:00",
  pt1metastatic2location: "肝",
  pt1metastatic2date: "2021-02-26 00:00:00",
  pt1metastatic3location: "肺",
  pt1metastatic3date: "2021-02-26 00:00:00",
  pt1metastatic4location: "11111",
  pt1metastatic4date: "2021-02-26 00:00:00",
  ptdxdescription2: "06-胃癌",
  ptdxdate2: "2021-02-11 12:43:43",
  ptdxdrgcategorycode2: "06-胃癌",
  ptdxrecurrencedate2: "2021-02-19 12:47:53",
  pt2metastatic1location: "无",
  pt2metastatic1date: "2021-02-19 00:00:00",
  pt2metastatic2location: "肝",
  pt2metastatic2date: "2021-02-19 00:00:00",
  pt2metastatic3location: "33333",
  pt2metastatic3date: "2021-02-18 00:00:00",
  pt2metastatic4location: "脑",
  pt2metastatic4date: null,
  ptdxdescription3: "11-头颈部肿瘤",
  ptdxdate3: "2021-02-19 11:16:25",
  ptdxdrgcategorycode3: "11-头颈部肿瘤",
  ptdxrecurrencedate3: "2021-02-18 18:12:41",
  pt3metastatic1location: null,
  pt3metastatic1date: null,
  pt3metastatic2location: null,
  pt3metastatic2date: null,
  pt3metastatic3location: null,
  pt3metastatic3date: null,
  pt3metastatic4location: null,
  pt3metastatic4date: null,
  isfirstcure: "Y",
  deathdate: "2021-02-18 09:04:05",
  deathreason: "其他肿瘤",
  deathdateuncertainty: null,
  failphone: null,
  lastupdatetime: "2021-02-08 17:33:52",
  followcount: null,
  isautoupdate: null,
  followtype: null,
  followupvariablemark: null,
  isdel: "0",
  pt1metastatic5date: "2021-02-19 00:00:00",
  pt1metastatic5location: "脑",
  pt2metastatic5date: "2021-02-18 00:00:00",
  pt2metastatic5location: "其他数据",
  pt3metastatic5date: null,
  pt3metastatic5location: null,
  createTime: null,
  groupName: "01-乳腺癌",
  groupCode: "01",
  visitNumber: "100086033",
};

let arr = [];
let dynamic={}
dataMap.forEach((item) => {
  if (item.key === "followupstatus") {
    const obj = {
      D: "死亡",
      O: "在访",
      L: "失访",
      R: "拒访",
    };
    dynamic = obj[info[item.key]];
  }
  arr.push({
    [item.key]: info[item.key],
    value:item.key === "followupstatus"?dynamic:info[item.key],
    name:item.name
  });
});

console.log(arr);
